package com.gmail.jaredjeya.awesomeplatformer;

import com.gmail.jaredjeya.awesomeplatformer.view.Dialogs;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;

public class LauncherActivity extends Activity {
	
	ImageButton play, options, quit, about, help;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_launcher);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
		
		play = (ImageButton) findViewById(R.id.startButton);
		options = (ImageButton) findViewById(R.id.optionsButton);
		quit = (ImageButton) findViewById(R.id.quitButton);
		about = (ImageButton) findViewById(R.id.aboutButton);
		help = (ImageButton) findViewById(R.id.helpButton);
		
		play.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = new Intent(LauncherActivity.this, MainActivity.class);
				startActivity(i);
				LauncherActivity.this.finish();
			}
		});
		
		options.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Dialogs.options(LauncherActivity.this);
				}
		});
		
		quit.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				LauncherActivity.this.finish();
			}
		});
		
		about.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Dialogs.about(LauncherActivity.this);
			}
		});
		
		help.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Dialogs.help(LauncherActivity.this, 0);
			}
		});
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.launcher, menu);
		return true;
	}

}
